import fetch from 'common/src/utils/fetch';


/**
 *不重考课程维护-新增
 */
function add(data) {
  return fetch({
    url: '/api/electionservice/undergraduateExamNoAfreshCourses/add',
    method: 'post',
    data
  })
}


/**
 *不重考课程维护(导出)
 */
function bReexamExport(data) {
  return fetch({
    url: '/api/electionservice/undergraduateExamNoAfreshCourses/bReexamExport',
    method: 'post',
    data
  })
}

/**
 *不重考课程维护(勾选导出)
 */
function bReexamExportSelected(data) {
  return fetch({
    url: '/api/electionservice/undergraduateExamNoAfreshCourses/bReexamExportSelected',
    method: 'post',
    data
  })
}

/**
 *无补考课程维护(勾选导出)
 */
function exportSelected(data) {
  return fetch({
    url: '/api/electionservice/undergraduateExamNoAfreshCourses/exportSelected',
    method: 'post',
    data
  })
}

/**
 *根据课程代码过滤课程
 */
function getCourse(data) {
  return fetch({
    url: '/api/electionservice/undergraduateExamNoAfreshCourses/getCourse',
    method: 'post',
    data
  })
}

/**
 *不重考课程维护-删除（包括批量）-新增
 */
function deleteData(data) {
  return fetch({
    url: '/api/electionservice/undergraduateExamNoAfreshCourses/delete',
    method: 'delete',
    data
  })
}

/**
 *不重考课程维护(导出)
 */
function exportData(data) {
  return fetch({
    url: '/api/electionservice/undergraduateExamNoAfreshCourses/export',
    method: 'post',
    data
  })
}

/**
 *不重考课程维护分页查询
 */
function getListPage(data) {
  return fetch({
    url: '/api/electionservice/undergraduateExamNoAfreshCourses/getListPage',
    method: 'post',
    data
  })
}

/**
 * 获取key
 */
function exportStatus(key) {
  return fetch({
    url: '/api/electionservice/reportManagement/result/' + key,
    method: 'get'
  });
}

/**
 *导入指定学期范围内的重缓考数据
 */
function importScoreResult(calendarIdOP,calendarIdEN) {
  return fetch({
    url: '/api/electionservice/undergraduateExamReexamScoreResult/import?calendarIdOP='+calendarIdOP+'&calendarIdEN=' + calendarIdEN,
    method: 'get'
  })
}

/**
 *删除/恢复重缓考数据（包括批量）
 *ids          id集合
 *deleteStatus 数据状态 1：删除，0：恢复
 */
function operationData(data,deleteStatus) {
  return fetch({
    url: '/api/electionservice/undergraduateExamReexamScoreResult/operationData?deleteStatus='+ deleteStatus ,
    method: 'post',
    data
  })
}

/**
 *本科生成绩分页查询
 */
function getScoreResultListPage(data) {
  return fetch({
    url: '/api/electionservice/undergraduateExamReexamScoreResult/getListPage',
    method: 'post',
    data
  })
}

/**
 *本科生成绩导出(条件导出)
 */
function exportListPage(data) {
  return fetch({
    url: '/api/electionservice/undergraduateExamReexamScoreResult/exportListPage',
    method: 'post',
    data
  })
}

/**
 *本科生成绩导出(勾选导出)
 */
function exportSelectedListPage(data,deleteStatus) {
  return fetch({
    url: '/api/electionservice/undergraduateExamReexamScoreResult/exportSelectedListPage?deleteStatus='+ deleteStatus ,
    method: 'post',
    data
  })
}

/**
 * 获取 key
 */
function getAutoExamKey(key) {
  return fetch({
    url:
      "/api/electionservice/schoolExamArrange/findAutoSchoolExamStatus?key=" +
      key,
    method: "get"
  });
}

export default {
  getListPage: getListPage,
  exportData: exportData,
  deleteData:deleteData,
  getCourse:getCourse,
  exportSelected:exportSelected,
  bReexamExportSelected:bReexamExportSelected,
  bReexamExport:bReexamExport,
  add:add,
  exportStatus: exportStatus,
  importScoreResult: importScoreResult,
  operationData: operationData,
  getScoreResultListPage: getScoreResultListPage,
  exportListPage: exportListPage,
  exportSelectedListPage: exportSelectedListPage,
  getAutoExamKey: getAutoExamKey
};
